﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;

namespace MoviesSample.Models
{
    public class Movie
    {
        [Display(Name ="电影编号")]
        public int ID { get; set; }
        [Display(Name ="电影名称")]
        public string Title { get; set; }

        [Display(ResourceType =typeof(DateTime))]
        [DataType(DataType.DateTime)]
        [DisplayFormat(DataFormatString ="{0:yy-MM-dd}",ApplyFormatInEditMode =true)]
        public DateTime ReleaseTime{get;set;}
        public decimal Price { get; set; }
    }
    public class MovieDBContext:DbContext
    {
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
        }
        public DbSet<Movie> Movies { get; set; }
    }
}